package com.solotiger.geographic.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

public class DatabaseHelper extends SQLiteOpenHelper {

    public final static int DATABASE_VERSION = 1;
    public final static String DATABASE_NAME = "geographic.db";
    public final static String DATABASE_TABLE_NAME = "Collects";

    private final static String CREATE_COLLECTS = "create table Collects (" +
            "uid integer primary key autoincrement, " +
            "id text," +
            "albumid text," +
            "title text," +
            "content text," +
            "url text)";

    public DatabaseHelper(Context context) {
        super(context, DATABASE_NAME, null, DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
        db.execSQL(CREATE_COLLECTS);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        db.execSQL("drop table if exists Collects");
        onCreate(db);
    }
}
